<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>

	<body>
		<iframe src="javascript: setTimeout(function () {console.log(obj);  });" frameborder="0"></iframe>

		<script>
			// TODO: 1. iframe 内部异常
			window.frames[0].onerror = function (message, source, lineno, colno, error) {
				console.log('捕获到 iframe 异常：', { message, source, lineno, colno, error });
			};
		</script>
	</body>
</html>
